package com.example.deal.broker.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import com.example.deal.broker.entity.Deal;
import com.example.deal.config.FeignConfig;

@RestController
public class BrokerController {
	
	@Autowired
	private FeignConfig feignConfig;
	
	@GetMapping("/deal/{id}")
	public Deal findById(@PathVariable(value="id") Long id) {
		return this.feignConfig.findById(id);
	}
	
	@GetMapping("/dealMock/{id}")
	public Deal findByIdMock(@PathVariable(value="id") Long id) {
		return this.feignConfig.findByIdMock(id);
	}
}